
namespace gen {

	template <class CompositorT>
	template <typename IteratorT>
	class neg_expr<CompositorT>::neg_expr_initializator 
	{
	private:
		domain<IteratorT> m_domain;
		
	public:
		neg_expr_initializator(domain<IteratorT> const& domain)
		: m_domain(domain)
		{}

		bool operator()(IteratorT const& i)
		{
			return !(m_domain.point(i));
		}
	};

	template <class CompositorT>
	template <typename ContextT>
	domain<typename ContextT::iterator_t>
	neg_expr<CompositorT>::evaluate(ContextT const& c) const
	{
		typedef typename ContextT::iterator_t iterator_t;
		typedef neg_expr_initializator<iterator_t> initializator_t;
		initializator_t init(expr.evaluate(c));
		domain<iterator_t> result(c.domain().first(), c.domain().last(), init);
		return result;
	}

}
